package org.dtrd.modules.patient.entity.bean.report;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author : qiannai
 * @date: 2022/8/23 16:57
 * @describe : 周报更新输入数据请求
 */
@ApiModel(value = "周报更新请求数据")
@Getter
@Setter
public class ReportWeekUpdateRequest {

    @ApiModelProperty(value = "报告id", required = true)
    @NotNull
    private Integer reportId;

    @ApiModelProperty(value = "本周问诊主要问题", required = true)
    @NotBlank
    private String mainQuestion;

    @ApiModelProperty(value = "前端上传的报告单图片路径，多张图片使用,进行分割")
    private String reportPictures;

    @ApiModelProperty(value = "发布状态")
    @NotNull
    private Integer publishStatus;

    @ApiModelProperty(value = "总结", required = true)
    @NotBlank
    private String summary;


    @ApiModel("数据库保存前端输入的Json类")
    @Getter
    @Setter
    public static class ReportWeekInputUpdate{

        @ApiModelProperty(value = "本周问诊主要问题")
        private String mainQuestion;

        @ApiModelProperty(value = "前端上传的报告单图片路径，多张图片使用,进行分割")
        private String reportPictures;

        /**
         * 将数据转化为Json进行保存
         * @return
         */
        public ReportWeekInputUpdate makeJson(ReportWeekUpdateRequest po) {
            ReportWeekInputUpdate reportWeekInputUpdate = new ReportWeekInputUpdate();
            reportWeekInputUpdate.setMainQuestion(po.mainQuestion);
            reportWeekInputUpdate.setReportPictures(po.reportPictures);
            return reportWeekInputUpdate;
        }
    }
}
